﻿namespace MelodysDemo.Core.Models
{
    /// <summary>
    /// 选项信息表
    /// </summary>
    [Table("survey_option")]
    [Index("QuestionId", Name = "question_key")]
    public partial class SurveyOption
    {
        public SurveyOption()
        {
            SurveyAnswerDetails = new HashSet<SurveyAnswerDetail>();
        }

        /// <summary>
        /// 自增主键
        /// </summary>
        [Key]
        [Column("id")]
        public long Id { get; set; }
        /// <summary>
        /// 问题ID
        /// </summary>
        [Column("question_id")]
        public long QuestionId { get; set; }
        /// <summary>
        /// 问卷ID
        /// </summary>
        [Column("questionnaire_id")]
        public long QuestionnaireId { get; set; }
        /// <summary>
        /// 选项序号
        /// </summary>
        [Column("sn")]
        public byte Sn { get; set; }
        /// <summary>
        /// 选项内容
        /// </summary>
        [Required]
        [Column("content")]
        [StringLength(256)]
        public string Content { get; set; }
        /// <summary>
        /// 分数
        /// </summary>
        [Column("score")]
        public byte Score { get; set; }
        /// <summary>
        /// 版本号
        /// </summary>
        [Column("version")]
        public long Version { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        [Required]
        [Column("creator")]
        [StringLength(64)]
        public string Creator { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        [Column("modified_time")]
        public DateTime ModifiedTime { get; set; }
        /// <summary>
        /// 修改人
        /// </summary>
        [Required]
        [Column("modifier")]
        [StringLength(64)]
        public string Modifier { get; set; }
        /// <summary>
        /// 是否删除，0：否，1：是
        /// </summary>
        [Column("is_delete")]
        public byte IsDelete { get; set; }

        [ForeignKey("QuestionId")]
        [InverseProperty("SurveyOptions")]
        public virtual SurveyQuestion Question { get; set; }
        [InverseProperty("Option")]
        public virtual ICollection<SurveyAnswerDetail> SurveyAnswerDetails { get; set; }
    }
}